//
//  IntroduceOrgViewController.m
//  EducationOID
//
//  Created by slz on 2017/6/15.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "IntroduceOrgViewController.h"
#import "OIPubListViewController.h"

@interface IntroduceOrgViewController ()
@property (nonatomic,strong) PubListTableHeadView *headerView;
@property (nonatomic,strong) UIScrollView *scrollView;
@property (nonatomic,strong) UIView *contentView;

@end

@implementation IntroduceOrgViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.showNavigationBar = YES;
    [self setControllerTitle:@"中心介绍"];
    self.view.backgroundColor = [UIColor whiteColor];
    UIBarButtonItem * item = [UIBarButtonItem itemWithImage:@"top_back_1" selectImage:nil addTarget:self andAction:@selector(backAction)];
    self.navigationItem.leftBarButtonItem = item;

    
    [self initScrollView];
    // Do any additional setup after loading the view.
}

- (void)initScrollView{
    NSString * conetentString = @"        在教育部和工信部的指导下，经国家OID注册解析中心批准，中央电教馆正式成立了“国家教育OID注册解析中心”，该中心是国家中心在教育领域的唯一分支机构，职能是为教育领域内的资源、设备等任何物品提供全球唯一、符合国际规范的OID标识并通过二维码予以呈现，同时建立一整套基于OID二维码的标准规范体系，为物联网在教育领域内的快速发展提供强有力的支撑。\n\n        中心具体工作由中央电教馆教育二维码推广办公室承担，前期开展的工作主要是：\n\n        （1）为国家教育资源公共服务平台和各省级平台的资源及功能服务提供唯一的二维码标识，为国家平台和省级平台的互联互通提供前期物理保障；\n\n        （2）在条件成熟的省份逐步建立若干省级注册分中心和省级产品追溯平台，首先能够实现省内各级教育主管部门对本省教育信息化产品的使用和分布进行有效的监管；其次依托分中心可以在省内逐步开展各类二维码应用的尝试，使得二维码的规范化应用能够渗透到教育教学的各个环节，助力教育信息化的快速发展，最终实现物联网在该省教育领域内的全面推广。";
    
    CGFloat contentHieght = [conetentString heightWithFont:[UIFont systemFontOfSize:14] width:kScreenWidth - 22 numberOfLines:0] + 190;
    
    
    _scrollView = [UIScrollView new];
    [self.view addSubview:_scrollView];
    [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.view);
    }];
    
    _contentView = [UIView new];
    [_scrollView addSubview:_contentView];
    [_contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.scrollView);
        make.width.equalTo(self.scrollView);
        make.height.mas_equalTo(contentHieght);
    }];

    
    _headerView = [[PubListTableHeadView alloc]init];
    _headerView.titleLabel.text = @"中心介绍";
    _headerView.size = CGSizeMake(kScreenWidth, 80);
    [_contentView addSubview:_headerView];
    
    UILabel * titleLabel = [UILabel new];
    titleLabel.textColor = [UIColor blackColor];
    titleLabel.fontSize = 17;
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"国家教育OID注册解析中心";
    [_contentView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_headerView.mas_bottom).offset(20);
        make.centerX.mas_equalTo(_contentView.mas_centerX);
    }];

    UILabel * subTitle = [UILabel new];
    subTitle.textColor = kDark_TextColor_Default;
    subTitle.fontSize = 15;
    subTitle.textAlignment = NSTextAlignmentCenter;
    subTitle.text = @"中央电化教育馆";
    [_contentView addSubview:subTitle];
    [subTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(titleLabel.mas_bottom).offset(20);
        make.centerX.mas_equalTo(titleLabel.mas_centerX);
    }];
    
    
    UILabel * contentLabel = [UILabel new];
    contentLabel.text = conetentString;
    contentLabel.textColor = kDark_TextColor_Default;
    contentLabel.numberOfLines = 0;
    contentLabel.fontSize = 14;
    [_contentView addSubview:contentLabel];
    [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_contentView.mas_left).offset(11);
        make.right.mas_equalTo(_contentView.mas_right).offset(-11);
        make.top.mas_equalTo(subTitle.mas_bottom).offset(15);
    }];
    
    
}

- (void)backAction{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
